package com.sunlands.deskmate.client;

import com.sunlands.deskmate.config.OauthFeignConfig;
import com.sunlands.deskmate.vo.OnlineStateVO;
import com.sunlands.deskmate.vo.UsersExtInfoVO;
import com.sunlands.deskmate.vo.UsersVO;
import com.sunlands.deskmate.vo.response.BusinessResult;
import com.sunlands.deskmate.vo.response.PageResultVO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * @author shixiaopeng
 */
@SuppressWarnings("unused")
@FeignClient(value = "tz-user-center", configuration = OauthFeignConfig.class)
public interface UserCenterService {

    /**
     * 查询用户列表
     *
     * @param idList
     * @return
     */
    @ApiOperation(value = "根据idList查询", notes = "根据idList查询")
    @PostMapping("/users/list")
    BusinessResult<List<UsersVO>> findByIdIn(@RequestBody List<Long> idList);

    @RequestMapping(value = "/users/{id}", method = RequestMethod.GET)
    BusinessResult<UsersVO> getUserInfoById(@PathVariable("id") Long userId);

    @GetMapping("/users/user/max-id")
    BusinessResult<Integer> maxUserId();

    @GetMapping("/users/user/ext-info/page")
    BusinessResult<PageResultVO<UsersExtInfoVO>> userExtPage(@ApiParam(value = "页码") @RequestParam(value = "page", defaultValue = "1") Integer page,
                                                             @ApiParam(value = "页码大小") @RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize);

    @GetMapping("/users/user/ext/{id}")
    BusinessResult<UsersExtInfoVO> userExt(@ApiParam(value = "用户id") @PathVariable("id") Long id);

    @PutMapping("/users/update/online")
    BusinessResult updateOnline( @RequestBody OnlineStateVO onlineState);
}

